/*
GANESHA - Reasoning on critical infrastructures affected by emergency situations
Copyright (c) 2010-2011, Information Eng. Research Unit - Univ. of Alcala
http://www.cc.uah.es/ie
This library is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 2.1 of the License, or (at your option)
any later version.
This library is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.
You should have received a copy of the GNU Lesser General Public License along
with this library; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

package es.uah.cc.ie.ganesha.messaging.position;

/**
 * Represents a point position.
 * @author ieru
 */
public class PointPosition extends MessagePosition {

	private double _latitude, _longitude;
	
	/**
	 * Constructor
	 * @param latitude Latitude
	 * @param longitude Longitude
	 */
	public PointPosition(double latitude, double longitude)
	{
		_latitude = latitude;
		_longitude = longitude;
	}

	/**
	 * Returns the point latitude
	 * @return Point latitude
	 */
	@Override
	public double getCenterLatitude() {
		return _latitude;
	}

	/**
	 * Returns the point longitude
	 * @return Point longitude
	 */
	@Override
	public double getCenterLongitude() {
		return _longitude;
	}

	/**
	 * Checks if a given point is in the point area (ie is the same point)
	 * @param latitude Latitude
	 * @param longitude Longitude
	 * @return true if the given point is the current point, false if not
	 */
	@Override
	public boolean isInArea(double latitude, double longitude) {
		return _latitude == latitude && _longitude == longitude;
	}

}
